package com.ficus.road.maintain.controller;

import com.ficus.road.maintain.core.model.CarVO;
import com.ficus.road.maintain.service.coverage.YtCoverageTask;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author xiawen yang
 * @date 2022/9/14 上午11:56
 */
@RestController
@Slf4j
@RequiredArgsConstructor
public class CoverageController {
    private final YtCoverageTask ytCoverageTask;
    @RequestMapping(value = "/coverage/init",
            method = RequestMethod.GET)
    public ResponseEntity<List<CarVO>> search(@RequestParam(required = false) String day) {
        ytCoverageTask.initCoverageRoadCoverageByDay(day);
        return new ResponseEntity<>(HttpStatus.OK);
    }
}
